<?php


function daemon()
{
    umask(0);
    $pid = pcntl_fork();
    if ($pid>0){
        exit(0);
    }
    posix_setsid();

    $pid = pcntl_fork();
    if ($pid>0){
        exit(0);
    }
    sleep(100);
}

daemon();

├─php(6177)
           ├─php(7410)
           ├─php(12767)
